<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
		<meta name="author" content="hexinyang">
		<title>卡片查询</title>
		<script language="javascript" src="../script/common.js" type="text/javascript"></script>	
		<script language="javascript" src="../script/card.js" type="text/javascript"></script>			
		<script type="text/javascript">
		function load(){
			Eui.showNavigation();
			Rpc.loadPage("carddiv","/card/contrast_card_div.html")
		}
		function onReadCard(){
		
			Rpc.loadPage("carddiv","/card/contrast_card_div.html")
			if(readCardForm) readCardForm.reset();

			try{
				//如果读取积分需要先同步方式取服务器时间
				var data = CardMgnt.onFindCard(readCardForm,"mgntQueryService.getCardQuery",null,true);
				if (data.cardUser){
					readCardForm.cardBalance.value = Format.fenToYuan(getCardBalance(data.cardPin));
					readCardForm.cardLoyaltyBalance.value = Format.fenToYuan(getLoyaltyBalance(data.serverTime));
					CardMgnt.contrastCard(readCardForm,data.cardInfo)
				}
			}catch(e){
				showError(e.description);
			}
		}
		function onCancel(){
			Rpc.loadPage("carddiv","/card/contrast_card_div.html");
			if(readCardForm) readCardForm.reset();
		}
		</script>
	</head>
	<body onload="load()" onunload="releaseCard()">
		<div class="nav"><div id="nav">&nbsp;</div></div>
		<div id="readcardview">
			<div class="form">
				<form name="readCardForm" id="readCardForm">
					<div id="carddiv"></div>
					<div>
						<table cellSpacing="0" cellPadding="4" width="100%" border="0" class="label6 col2">
							<tr>
								<td><label>有 效 期</label> <input type="text" name="expiredTime" readonly class="readonly"></td>
								<td><label>卡子类型</label> <input type="text" name="subCardTypeText" readonly class="readonly"></td>
							</tr>		
							<tr>
								<td><label>卡片状态</label> <input type="text" name="statusText" readonly class="readonly"></td>
								<td><label>黑名单类型</label> <input type="text" name="blackTypeText" readonly class="readonly"></td>
							</tr>
							<tr>
								<td><label>卡 余 额</label> <input type="text" name="cardBalance" readonly class="readonly"> 元</td>
								<td><label>卡内积分</label> <input type="text" name="cardLoyaltyBalance" readonly class="readonly"> 分</td>							
							</tr>
							<tr>
								<td><label>后台卡余额</label> <input type="text" name="balance" readonly class="readonly"> 元</td>
								<td><label>后台积分</label> <input type="text" name="loyaltyBalance" readonly class="readonly"> 分</td>							
							</tr>
							<tr>
								<td><label>备用金余额</label> <input type="text" name="spareBalance" readonly class="readonly"> 元</td>
								<td><label>备用积分</label> <input type="text" name="spareLoyaltyBalance" readonly class="readonly"> 分</td>							
							</tr>
						</table>
					</div>
				</form>
			</div>
			<p>
				<button type="button" name="saveBtn" onclick="onReadCard()">读 卡</button>
				<button type="button" onclick="onCancel()">重 置</button>
			</p>
		</div>
	</body>
</html>